package com.xyzh.application.base.vo;

import com.xyzh.application.base.entity.UserEntity;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.List;

/**
 * @author JZB
 * @date 2022年11月03日 10:31
 * @Description
 */
@Data
public class AuthorUser extends UserEntity implements UserDetails {

    private Collection<? extends GrantedAuthority> authorities;




    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return authorities;
    }




    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        boolean enable= getEnabled() == 1;
        System.out.println(getEnabled());
        return enable;
    }
}
